﻿<?php
include("mysql.php");
if ( $_GET['act'] == "them_menu" )
{
	$m_title = addslashes($_POST['m_title']);
	$m_link = addslashes($_POST['m_link']);
	if (!$m_title )
	{
		echo " Vui long dien tieu de menu ";exit();
	}
	$up_menu = mysql_query ("INSERT INTO menu(m_title,m_link) values ('{$m_title}','{$m_link}') ");
	if ($up_menu)
	{
		echo " Them {$m_title} thanh cong ! ";exit();
	}
	else
	{
		echo " Loi ! Vui long lien he cho BQT ";exit();
	}
}
?>
<form action="addmenu.php?act=them_menu" method="post" >
	<table width="60%" align="center" border="0" >
		<tr>
			<td>Tieu de menu :</td>
			<td><input type="text" name="m_title" /></td>
		</tr>
		<tr>
			<td> Link dan den :</td>
			<td><input type="text" name="m_link" /></td>
		</tr>
		<tr>
			<td colspan="2"><input type="submit" name="submit" value="Them menu" />
							<input type="reset" name="B2" value="Nhap lai" />
			</td>
		</tr>
		</tr>
	</table>
</form>